Simple changes for uninteresting non-problems.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 17 Feb 2014 06:35:06 +0000 (06:35 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 17 Feb 2014 06:35:06 +0000 (06:35 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4748 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/csv_util.cc
gpsbabel/exif.cc
gpsbabel/mmo.cc
gpsbabel/unicsv.cc

index d1531ea0cb22a7472462386392631b86153cc999..7c6b208d6d67e19faf7852971c6ccc6962c1aae5 100644 (file)
@@ -918,7 +918,7 @@ addhms(const char* s, const char* format)
   char* ampm = NULL;
   int ac;
 
-  ampm = (char*) xmalloc(strlen(s));
+  ampm = (char*) xmalloc(strlen(s) + 1);
   ac = sscanf(s, format, &hour, &min, &sec, &ampm);
   /* If no time format in arg string, assume AM */
   if (ac < 4) {
index cbb751d55cffd8498f1432e854bafe7b44632b62..56875e88e4a419e2b518c64766de1e32137f780f 100644 (file)
@@ -1278,7 +1278,7 @@ exif_write_apps(void)
 
       len += 4; /* DWORD(0) after last ifd */
 
-      if ((tag = exif_find_tag(app, IFD1, IFD1_TAG_JPEG_OFFS))) {
+      if ((exif_find_tag(app, IFD1, IFD1_TAG_JPEG_OFFS))) {
         exif_put_long(IFD1, IFD1_TAG_JPEG_OFFS, 0, len);
       }
 
index 17f5c54e8c1390a043ec2fbb1b90ee87f209c392..5668af700ad5e0b8b4a31bc13073b46215f08608 100644 (file)
@@ -629,7 +629,7 @@ mmo_read_CObjRoute(mmo_data_t* data)
 
     DBG((sobj, "read next waypoint\n"));
     tmp = mmo_read_object();
-    if (tmp && tmp->data && (tmp->type = wptdata)) {
+    if (tmp && tmp->data && (tmp->type == wptdata)) {
       Waypoint* wpt;
 
       /* FIXME: At this point this waypoint maybe not fully loaded (initialized) !!!
index 7b73b29fd26e71139f467cb09a13f76e8c3e4a8c..d73ed11507033c52bb100e68454b165cb7406614 100644 (file)
@@ -639,6 +639,7 @@ unicsv_parse_one_line(char* ibuf)
   double utm_easting = 0;
   double utm_northing = 0;
   char utm_zc = 'N';
+  // Zones are always two bytes.  Spare one for null termination..
   char bng_zone[3] = "";
   double bng_easting = 0;
   double bng_northing = 0;
@@ -761,7 +762,7 @@ unicsv_parse_one_line(char* ibuf)
       break;
 
     case fld_bng_zone:
-      strncpy(bng_zone, s, sizeof(bng_zone));
+      strncpy(bng_zone, s, sizeof(bng_zone) -1 );
       strupper(bng_zone);
       break;